import { lazy } from 'react'

import { createBrowserRouter, Navigate } from 'react-router-dom'
import Home from '@/views/home'

const Login = lazy(() => import('@/views/login'))
// const Business = lazy(() => import('@/views/business'))
// const Redirect = <Navigate to={isOperator ? 'agent' : 'tenant'} />

const router = createBrowserRouter([
    {
        path: '/',
        element: <Home />,
        // errorElement: Redirect,
        children: [
            // {
            //     index: true,
            //     element: Redirect
            // },
            // {
            //     path: 'business',
            //     element: <Business />,
            //     index: true,
            // },
        ]
    }, {
        path: '/login',
        element: <Login />
    }
])

export default router
